{% extends "list.html" %}

{% block list_header %}
    {{ layout.query_options(search_label = 'search features by title or artist name') }}
{% endblock %}

{% block table_head %}
    <th>magazine</th>
    <th>issue</th>
    <th>column</th>
    <th>feature title</th>
    <th>artist</th>
    <th></th>
{% endblock %}

{% block table_body %}
    {% for item in context[scaffolding.plural] %}
        {% set issue = item['issue'].get() %}
        <tr>
            <td>{% if issue %}<a href="{{uri('magazines:view', key=issue.publication.urlsafe())}}">{{s.print_value(issue.publication)}}</a>{% endif %}</td>
            <td>{% if issue %}<a href="{{uri('issues:view', key=item['issue'].urlsafe())}}">{{s.print_value(issue.number_period_year())}}</a>{% endif %}</td>
            <td><a href="{{uri('columns:view', key=item['column'].urlsafe())}}">{{s.print_value(item['column'])}}</a></td>
            <td>{{s.print_value(item['description'])}}</td>
            <td>{% if item['artist'] %}<a href="{{uri('artists:view', key=item['artist'].urlsafe())}}">{{s.print_value(item['artist'])}}</a>{% endif %}</td>
            <td class="text-right">
                {{ buttons.view_edit_delete_buttons(item, target='feature')}}
            </td>
        </tr>
    {% endfor %}
{% endblock %}
